
def chain1(*iterables):
    for it in iterables:
        for i in it:
            yield i

def chain2(*iterables):
    """
    chain2 把不同的生成器结合使用，常用的用法是替换嵌套循环

    Yields:
        [type]: list of iterables
    """
    for it in iterables:
        yield from it


if __name__ == "__main__":
    s = 'abc'
    t = range(3)
    print(list(chain1(s, t)))

